home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
hity wydania
/
trueSpace 7.6
/
tS761B8Std.exe
/
{app}
/
Scripts
/
MaterialEditor
/
Bricks
/
Compound
/
ThresholdHatching.Brick.xml
< prev
Wrap
Extensible Markup Language
|
2008-06-10
|
2KB
|
36 lines
<?xml version="1.0" encoding="utf-8" ?>
<ME_BRICK GUID="{EA23D62B-19A8-4c84-BADD-BE74BD008E61}" Name="RtTSHatcher" GUIName="Hatching NPR" Description="The hatching non photo realistic rendering">
<ME_BRICK_INPUTPARAM GUID="{3420C33D-5629-4012-A1BF-45A52D835D74}" Name="Intensity" Type="RtFloat4"/>
<ME_BRICK_INPUTPARAM GUID="{09C0EEDF-B910-4ac9-B796-8E94E08C99B3}" Name="Texcoords" Type="RtFloat3"/>
<ME_BRICK_INPUTPARAM GUID="{B481FAEC-EAAB-44b1-A551-135FC03E3374}" Name="HatchingTexture" Type="RtSampler2D"/>
<ME_BRICK_OUTPUTPARAM GUID="{C30236E3-8E0A-4b83-881D-86B32F33CB64}" Name="ResultColor" Type="RtFloat4"/>
<ME_BRICK_CODE><![CDATA[
void RtTSHatcher(in RtFloat4 Intensity, in RtFloat3 Texcoords,
in RtSampler2D HatchingTexture, out RtFloat4 ResultColor)
{
//ResultColor = RtFloat4(0,0,0,0);
float StrokeIntensity = 0.0f;
float2 offset00 = float2(0.28, 0.38);
float2 offset01 = float2(0.26, 0.22);
float2 Tex0 = Texcoords.xy;
float2 Tex1 = Tex0.xy + offset00;
float2 Tex2 = Tex0.xy + offset01;
float4 stroke1 = tex2D(HatchingTexture, Tex0);
StrokeIntensity = (Intensity < 5.0/7.0 + stroke1.w/7.0) ? stroke1.x : 1.0f;
StrokeIntensity *= (Intensity < 2.0/7.0 + stroke1.z/7.0) ? stroke1.y : 1.0f;
float4 stroke2 = tex2D(HatchingTexture, Tex1);
StrokeIntensity *= (Intensity < 4.0/7.0 + stroke2.w/7.0) ? stroke2.x : 1.0f;
StrokeIntensity *= (Intensity < 1.0/7.0 + stroke2.z/7.0) ? stroke2.y : 1.0f;
float4 stroke3 = tex2D(HatchingTexture, Tex2);
StrokeIntensity *= (Intensity < 3.0/7.0 + stroke3.w/7.0) ? stroke3.x : 1.0f;
StrokeIntensity *= (Intensity < 0.0/7.0 + stroke3.z/7.0) ? stroke3.y : 1.0f;
ResultColor = StrokeIntensity * Intensity;
}
]]></ME_BRICK_CODE>
</ME_BRICK>